package com.lzq.model.visitor.staticdispatch;

/**
 * @author : modify
 * @version : v1.0
 * @description :
 * @createTime : 2022/11/29 15:17
 * @updateUser : modify
 * @updateTime : 2022/11/29 15:17
 * @updateRemark : 静态分派
 */
public class Static {
    public static void main(String[] args) {
        Animal a = new Animal();
        Animal a1 = new Dog();

        Execute exe = new Execute();
        exe.execute(a);
        exe.execute(a1);
    }
}

class Animal {
}

class Dog extends Animal {
}

class Execute {
    public void execute(Animal a) {
        System.out.println("Animal");
    }

    public void execute(Dog d) {
        System.out.println("dog");
    }
}
